package com.heima.app;

import com.heima.Dao.BookDao;
import com.heima.Service.BookService;
import com.heima.Controller.BookController;
import com.heima.util.ToolsUtils;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Appone {
    public static void main(String[] args) {
        ApplicationContext ctx =
                new ClassPathXmlApplicationContext("ApplicationController.xml");

        //4.获取bean
        BookDao bookdao = (BookDao) ctx.getBean("bookDaoImpl");
        bookdao.save();

        BookService bookServiceImpl = (BookService) ctx.getBean("bookServiceImpl");
        bookServiceImpl.save();

        BookController bookController = (BookController) ctx.getBean("bookController");
        bookController.save();

        ToolsUtils toolsUtils = (ToolsUtils) ctx.getBean("toolsUtils");
        toolsUtils.copy();
    }
}
